package com.kucun.service.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kucun.Dao.UsersMapper;
import com.kucun.bean.Page;
import com.kucun.bean.Users;
import com.kucun.service.Userservice;
@Service
@Transactional 
public class Userserviceimp implements Userservice {

	@Resource
	private UsersMapper usersMapper;
	public boolean save(Users record) {
		return usersMapper.insert(record);
	}

	public boolean update(Users record) {
		return usersMapper.updateByPrimaryKey(record);
	}

	public boolean delete(String id) {
		return usersMapper.delete(id);
	}


	public Users findById(int userid) {
		return usersMapper.selectByPrimaryKey(userid);
	}


	public List<Users> findAll(Page page) {
		return (List<Users>)usersMapper.findAll(page);
	}

	public Users login(String logname) {
		return usersMapper.login(logname);
	}

	public Page getCount(String obj) {
		
		return usersMapper.getCount(obj);
	}

	
	public List<Users> query(String y, String s,int i,int rows) {
		return (List<Users>)usersMapper.query(y, s,i,rows);
	}

	public Page queryCount(String y, String s) {
		return usersMapper.queryCount(y, s);
	}

	public Integer updateUserPassword(Users users) {
		return usersMapper.updateByPrimaryKeySelective(users);
	}

	@Override
	public List<Users> GetAllUsers(Page page) {
		return usersMapper.GetAllUsers(page);
	}

	@Override
	public Page getUsersCount(Page page) {
		return usersMapper.getUsersCount(page);
	}

	@Override
	public Integer updateByPrimaryKeySelective(Users users) {
		return usersMapper.updateByPrimaryKeySelective(users);
	}

	@Override
	public Integer insertSelective(Users users) {
		return usersMapper.insertSelective(users);
	}

}
